const fs = require('fs');
const promise = require('util').promisify;

// const read = promise(fs.readFile);

// read('./42_promisify.js').then(data => {
//     console.log(data);
// }).catch(ex => {
//     console.log(ex);
// });

async function test(){
    try{
        const content = await read('./42_promisify.js');
        console.log(content.toString());
    }catch(ex){
        console.log(ex);
    }
}

test();